<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Log
 *
 * @author hackc
 */
namespace Think\Log\Driver;
class Log {
    
    protected $config = array(
        "db_name"       =>  "Log",
    );
    
    //实例化并传入参数
    public function __construct($config = array()) {
        $this->config       = array_merge($this->config,$config);
    }
    
    /**
     * 日志写入接口
     * @access public
     * @param string $log 日志信息
     * @param string $destination  写入目标库
     * @return void
     */
    public function write($log,$destination=""){
        $model['log'] = $log;
        $model['log_time'] = time();
        M($this->config['db_name'])->add($model);
    }
}
